//
//  MeButton.m
//  zctx
//
//  Created by apple on 15/12/23.
//  Copyright © 2015年 sanliang. All rights reserved.
//

#import "MeButton.h"

@implementation MeButton


-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = [UIFont systemFontOfSize:19];
        [self addSubview:self.contentLable];
        self.titleEdgeInsets = UIEdgeInsetsMake(-20, 0, 0, 0);
        
        [self.contentLable makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.centerY).with.offset(10);
            make.centerX.equalTo(self.centerX).with.offset(0);
            make.width.equalTo(self.width).with.offset(0);
            make.height.mas_equalTo(21);
        }];
    }
    return self;
}

-(void)setTitle:(NSString *)title{
    _title = title;
    [self setTitle:title forState:UIControlStateNormal];
}
-(void)setContent:(NSString *)content{
    _content = content;
    [self.contentLable setText:content];
}
-(void)setTitleColor:(UIColor *)titleColor{
    [self setTitleColor:titleColor forState:UIControlStateNormal];
}

-(void)setContentColor:(UIColor *)contentColor{
    self.contentLable.textColor = contentColor;
}

-(UILabel *)contentLable{
    if (!_contentLable) {
        _contentLable = [[UILabel alloc]init];
        _contentLable.textAlignment = NSTextAlignmentCenter;
        _contentLable.font = [UIFont systemFontOfSize:15];
//        _contentLable.backgroundColor = [UIColor orangeColor];
        _contentLable.text = @"撒旦法师";
    }
    return _contentLable;
}
@end
